<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  <title>WO！女神</title>
  <script src="./lib/wyrem.js"></script>
  <script src="./lib/jquery-1.8.2.min.js"></script>
  <style>
    html {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
    }

    body {
      width: 100%;
      height: 100%;
      font-size: 24px;
    }

    #app {
      width: 100%;
      height: 100%;
      text-align: center;
      background: #ffe2e4;
    }

  </style>
</head>

<body>

</body>
<script>
  function weChatRefresh() {
    var isPageHide = false;
    window.addEventListener('pageshow', function () {
      if (isPageHide) {
        location.reload(true);
      }
    });
    window.addEventListener('pagehide', function () {
      isPageHide = true;
    });
  }
  weChatRefresh();

  function GetRequest() {
    var e = location.href;
    var f = {};
    if (e.indexOf("?") != -1) {
      var g = e.substr(e.indexOf("?") +
        1);
      g = g.split("&");
      for (var h = 0; h < g.length; h++) {
        f[g[h].split("=")[0]] = decodeURI(g[h].split("=")[1]);
      }
    }
    return f;
  }
  $.ajax({
    type: 'get',
    url: 'http://wxjx.unisk.cn/wxjx/goddess/common/share/updateShareOpenNum',
    data: '',
    success: function (result) {
      console.log('GetRequest().state', GetRequest().state);
      // return;
      if (Boolean(GetRequest().state)) {
        $.ajax({
          type: 'get',
          url: 'http://wxjx.unisk.cn/wxjx/goddess/common/user/queryInfoById',
          data: {
            id: GetRequest().state
          },
          success: function (result) {
            if ('999' != result.code) {
              location.href =
                'http://wxjx.unisk.cn/pages/2018/wxjx/schoolBeautyGirl/index.html#/vote?openid=' +
                GetRequest().openid +
                '&userid=' + GetRequest().state
            }
          }
        })
      } else {
        location.href =
          'http://wxjx.unisk.cn/pages/2018/wxjx/schoolBeautyGirl/index.html#/?openid=' + GetRequest().openid

      }
    }
  })

</script>

</html>
